/*
 * Copyright 2010 Christoph Widulle (christoph.widulle@googlemail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */



package com.android1.amarena2d.animation;

import com.android1.amarena2d.texture.TextureAtlas;

/**
 * Provides static access to some AnimationBuilder.
 */
public final class Animations {

    public static final DefaultAnimationBuilder DEFAULT_ANIMATION_BUILDER = new DefaultAnimationBuilder();
    public static final AtlasAnimationBuilder ATLAS_ANIMATION_BUILDER = new AtlasAnimationBuilder();

    private Animations() {

    }

    /**
     * Returns a non-threadsafe, singelton instance of a DefaultAnimationBuilder to prevent unnecessary object creation.
     * Just use him for the moment. Does not fullfill standart Builder-Pattern Design features.
     *
     * @param delay
     * @return non-threadsafe, singelton instance of a DefaultAnimationBuilder
     */
    public static DefaultAnimationBuilder $(final float delay) {
        return DEFAULT_ANIMATION_BUILDER.init(delay);
    }

    /**
     * Returns a non-threadsafe, singelton instance to prevent unnecessary object creation.
     *
     * @param textureAtlas
     * @param delay
     * @return non-threadsafe, singelton instance of a AtlasAnimationBuilder
     */
    public static AtlasAnimationBuilder $(TextureAtlas textureAtlas, final float delay) {
        return ATLAS_ANIMATION_BUILDER.init(textureAtlas, delay);
    }

}
